"use strict";

const { cryptoEncode } = require("../utils/crypto");

const list = ["general", "admin", "root"].map((key, i) => {
  return {
    username: key,
    fullName: key,
    password: cryptoEncode("123456qwe."),
    phone: "1518888666" + i,
    email: key + "@qq.com",
    avatar: `http://${key}.com`,
    gender: 0,
    status: false,
    isDelete: false,
    createdAt: new Date(),
    updatedAt: new Date(),
  };
});

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.bulkInsert("Users", list, {});
  },

  async down(queryInterface, Sequelize) {
    await queryInterface.bulkDelete("Users", null, {});
  },
};
